{
  "openapi": "3.0.0",
  "info": {
    "title": "This package defines the Mixer API that the sidecar proxy uses to perform precondition checks, manage quotas, and report telemetry.",
    "version": "v1"
  },
  "components": {
    "schemas": {
      "istio.mixer.v1.Attributes": {
        "description": "Attributes represents a set of typed name/value pairs. Many of Mixer's API either consume and/or return attributes.",
        "type": "object",
        "properties": {
          "attributes": {
            "description": "A map of attribute name to its value.",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/istio.mixer.v1.Attributes.AttributeValue"
            }
          }
        }
      },
      "istio.mixer.v1.Attributes.AttributeValue": {
        "description": "Specifies one attribute value with different type.",
        "type": "object",
        "oneOf": [
          {
            "required": [
              "stringValue"
            ],
            "properties": {
              "stringValue": {
                "description": "Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI",
                "type": "string",
                "format": "string"
              }
            }
          },
          {
            "required": [
              "int64Value"
            ],
            "properties": {
              "int64Value": {
                "description": "Used for values of type INT64",
                "type": "integer",
                "format": "int64"
              }
            }
          },
          {
            "required": [
              "doubleValue"
            ],
            "properties": {
              "doubleValue": {
                "description": "Used for values of type DOUBLE",
                "type": "number",
                "format": "double"
              }
            }
          },
          {
            "required": [
              "boolValue"
            ],
            "properties": {
              "boolValue": {
                "description": "Used for values of type BOOL",
                "type": "boolean"
              }
            }
          },
          {
            "required": [
              "bytesValue"
            ],
            "properties": {
              "bytesValue": {
                "description": "Used for values of type BYTES",
                "type": "string",
                "format": "binary"
              }
            }
          },
          {
            "required": [
              "timestampValue"
            ],
            "properties": {
              "timestampValue": {
                "description": "Used for values of type TIMESTAMP",
                "type": "string",
                "format": "dateTime"
              }
            }
          },
          {
            "required": [
              "durationValue"
            ],
            "properties": {
              "durationValue": {
                "description": "Used for values of type DURATION",
                "type": "string"
              }
            }
          },
          {
            "required": [
              "stringMapValue"
            ],
            "properties": {
              "stringMapValue": {
                "$ref": "#/components/schemas/istio.mixer.v1.Attributes.StringMap"
              }
            }
          }
        ]
      },
      "istio.mixer.v1.Attributes.StringMap": {
        "description": "Defines a string map.",
        "type": "object",
        "properties": {
          "entries": {
            "description": "Holds a set of name/value pairs.",
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "string"
            }
          }
        }
      },
      "istio.mixer.v1.CompressedAttributes": {
        "description": "Defines a list of attributes in compressed format optimized for transport. Within this message, strings are referenced using integer indices into one of two string dictionaries. Positive integers index into the global deployment-wide dictionary, whereas negative integers index into the message-level dictionary instead. The message-level dictionary is carried by the `words` field of this message, the deployment-wide dictionary is determined via configuration.",
        "type": "object",
        "properties": {
          "strings": {
            "description": "Holds attributes of type STRING, DNS_NAME, EMAIL_ADDRESS, URI",
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          },
          "bytes": {
            "description": "Holds attributes of type BYTES",
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "binary"
            }
          },
          "words": {
            "description": "The message-level dictionary.",
            "type": "array",
            "items": {
              "type": "string",
              "format": "string"
            }
          },
          "int64s": {
            "description": "Holds attributes of type INT64",
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            }
          },
          "doubles": {
            "description": "Holds attributes of type DOUBLE",
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            }
          },
          "bools": {
            "description": "Holds attributes of type BOOL",
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "timestamps": {
            "description": "Holds attributes of type TIMESTAMP",
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "dateTime"
            }
          },
          "durations": {
            "description": "Holds attributes of type DURATION",
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "stringMaps": {
            "description": "Holds attributes of type STRING_MAP",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/istio.mixer.v1.StringMap"
            }
          }
        }
      },
      "istio.mixer.v1.StringMap": {
        "description": "A map of string to string. The keys and values in this map are dictionary indices (see the [Attributes][istio.mixer.v1.CompressedAttributes] message for an explanation)",
        "type": "object",
        "properties": {
          "entries": {
            "description": "Holds a set of name/value pairs.",
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      },
      "istio.mixer.v1.CheckRequest": {
        "description": "Used to get a thumbs-up/thumbs-down before performing an action.",
        "type": "object",
        "properties": {
          "attributes": {
            "$ref": "#/components/schemas/istio.mixer.v1.CompressedAttributes"
          },
          "globalWordCount": {
            "description": "The number of words in the global dictionary, used with to populate the attributes. This value is used as a quick way to determine whether the client is using a dictionary that the server understands.",
            "type": "integer"
          },
          "deduplicationId": {
            "description": "Used for deduplicating `Check` calls in the case of failed RPCs and retries. This should be a UUID per call, where the same UUID is used for retries of the same call.",
            "type": "string",
            "format": "string"
          },
          "quotas": {
            "description": "The individual quotas to allocate",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/istio.mixer.v1.CheckRequest.QuotaParams"
            }
          }
        }
      },
      "istio.mixer.v1.CheckRequest.QuotaParams": {
        "description": "parameters for a quota allocation",
        "type": "object",
        "properties": {
          "amount": {
            "description": "Amount of quota to allocate",
            "type": "integer",
            "format": "int64"
          },
          "bestEffort": {
            "description": "When true, supports returning less quota than what was requested.",
            "type": "boolean"
          }
        }
      },
      "istio.mixer.v1.CheckResponse": {
        "description": "The response generated by the Check method.",
        "type": "object",
        "properties": {
          "quotas": {
            "description": "The resulting quota, one entry per requested quota.",
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/istio.mixer.v1.CheckResponse.QuotaResult"
            }
          },
          "precondition": {
            "$ref": "#/components/schemas/istio.mixer.v1.CheckResponse.PreconditionResult"
          }
        }
      },
      "istio.mixer.v1.CheckResponse.PreconditionResult": {
        "description": "Expresses the result of a precondition check.",
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/google.rpc.Status"
          },
          "validDuration": {
            "description": "The amount of time for which this result can be considered valid.",
            "type": "string"
          },
          "validUseCount": {
            "description": "The number of uses for which this result can be considered valid.",
            "type": "integer",
            "format": "int32"
          },
          "referencedAttributes": {
            "$ref": "#/components/schemas/istio.mixer.v1.ReferencedAttributes"
          },
          "routeDirective": {
            "$ref": "#/components/schemas/istio.mixer.v1.RouteDirective"
          }
        }
      },
      "istio.mixer.v1.CheckResponse.QuotaResult": {
        "description": "Expresses the result of a quota allocation.",
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/google.rpc.Status"
          },
          "validDuration": {
            "description": "The amount of time for which this result can be considered valid.",
            "type": "string"
          },
          "referencedAttributes": {
            "$ref": "#/components/schemas/istio.mixer.v1.ReferencedAttributes"
          },
          "grantedAmount": {
            "description": "The amount of granted quota. When `QuotaParams.best_effort` is true, this will be \u003e= 0. If `QuotaParams.best_effort` is false, this will be either 0 or \u003e= `QuotaParams.amount`.",
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "istio.mixer.v1.ReferencedAttributes": {
        "description": "Describes the attributes that were used to determine the response. This can be used to construct a response cache.",
        "type": "object",
        "properties": {
          "words": {
            "description": "The message-level dictionary. Refer to [CompressedAttributes][istio.mixer.v1.CompressedAttributes] for information on using dictionaries.",
            "type": "array",
            "items": {
              "type": "string",
              "format": "string"
            }
          },
          "attributeMatches": {
            "description": "Describes a set of attributes.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/istio.mixer.v1.ReferencedAttributes.AttributeMatch"
            }
          }
        }
      },
      "istio.mixer.v1.RouteDirective": {
        "description": "Expresses the routing manipulation actions to be performed on behalf of Mixer in response to a precondition check.",
        "type": "object",
        "properties": {
          "requestHeaderOperations": {
            "description": "Operations on the request headers.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/istio.mixer.v1.HeaderOperation"
            }
          },
          "responseHeaderOperations": {
            "description": "Operations on the response headers.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/istio.mixer.v1.HeaderOperation"
            }
          },
          "directResponseCode": {
            "description": "If set, enables a direct response without proxying the request to the routing destination. Required to be a value in the 2xx or 3xx range.",
            "type": "integer"
          },
          "directResponseBody": {
            "description": "Supplies the response body for the direct response. If this setting is omitted, no body is included in the generated response.",
            "type": "string",
            "format": "string"
          }
        }
      },
      "istio.mixer.v1.ReferencedAttributes.AttributeMatch": {
        "description": "Describes a single attribute match.",
        "type": "object",
        "properties": {
          "name": {
            "description": "The name of the attribute. This is a dictionary index encoded in a manner identical to all strings in the [CompressedAttributes][istio.mixer.v1.CompressedAttributes] message.",
            "type": "integer",
            "format": "int32"
          },
          "condition": {
            "$ref": "#/components/schemas/istio.mixer.v1.ReferencedAttributes.Condition"
          },
          "regex": {
            "description": "If a REGEX condition is provided for a STRING_MAP attribute, clients should use the regex value to match against map keys.",
            "type": "string",
            "format": "string"
          },
          "mapKey": {
            "description": "A key in a STRING_MAP. When multiple keys from a STRING_MAP attribute were referenced, there will be multiple AttributeMatch messages with different map_key values. Values for map_key SHOULD be ignored for attributes that are not STRING_MAP.",
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "istio.mixer.v1.ReferencedAttributes.Condition": {
        "description": "How an attribute's value was matched",
        "type": "string",
        "enum": [
          "CONDITION_UNSPECIFIED",
          "ABSENCE",
          "EXACT",
          "REGEX"
        ]
      },
      "istio.mixer.v1.HeaderOperation": {
        "description": "Operation on HTTP headers to replace, append, or remove a header. Header names are normalized to lower-case with dashes, e.g. \"x-request-id\". Pseudo-headers \":path\", \":authority\", and \":method\" are supported to modify the request headers.",
        "type": "object",
        "properties": {
          "name": {
            "description": "Header name.",
            "type": "string",
            "format": "string"
          },
          "value": {
            "description": "Header value.",
            "type": "string",
            "format": "string"
          },
          "operation": {
            "$ref": "#/components/schemas/istio.mixer.v1.HeaderOperation.Operation"
          }
        }
      },
      "istio.mixer.v1.HeaderOperation.Operation": {
        "description": "Operation type.",
        "type": "string",
        "enum": [
          "REPLACE",
          "REMOVE",
          "APPEND"
        ]
      },
      "istio.mixer.v1.ReportRequest": {
        "description": "Used to report telemetry after performing one or more actions.",
        "type": "object",
        "properties": {
          "attributes": {
            "description": "next value: 5",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/istio.mixer.v1.CompressedAttributes"
            }
          },
          "globalWordCount": {
            "description": "The number of words in the global dictionary. To detect global dictionary out of sync between client and server.",
            "type": "integer"
          },
          "repeatedAttributesSemantics": {
            "$ref": "#/components/schemas/istio.mixer.v1.ReportRequest.RepeatedAttributesSemantics"
          },
          "defaultWords": {
            "description": "The default message-level dictionary for all the attributes. Individual attribute messages can have their own dictionaries, but if they don't then this set of words, if it is provided, is used instead.",
            "type": "array",
            "items": {
              "type": "string",
              "format": "string"
            }
          }
        }
      },
      "istio.mixer.v1.ReportRequest.RepeatedAttributesSemantics": {
        "description": "Used to signal how the sets of compressed attributes should be reconstituted server-side.",
        "type": "string",
        "enum": [
          "DELTA_ENCODING",
          "INDEPENDENT_ENCODING"
        ]
      },
      "istio.mixer.v1.ReportResponse": {
        "description": "Used to carry responses to telemetry reports",
        "type": "object"
      },
      "google.rpc.Status": {
        "description": "A status code of OK indicates quota was fetched successfully. Any other code indicates error in fetching quota.",
        "type": "object",
        "properties": {
          "code": {
            "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].",
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.",
            "type": "string",
            "format": "string"
          },
          "details": {
            "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "@type"
              ],
              "properties": {
                "@type": {
                  "description": "A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `type.googleapis.com/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). The remaining fields of this object correspond to fields of the proto messsage. If the embedded message is well-known and has a custom JSON representation, that representation is assigned to the 'value' field.",
                  "type": "string",
                  "format": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}